package com.miracle9.game.service;

import org.apache.mina.core.session.IoSession;

import java.util.HashMap;
import java.util.Map;

public class BaseService {

    protected Map<String, Object> resultFormat(boolean success, String message) {
        Map<String, Object> result = new HashMap();
        result.put("success", Boolean.valueOf(success));
        result.put("message", message);
        return result;
    }

    protected int resultInt(IoSession session) {
        if(session==null) {
            return 0;
        }
        return ((Integer) session.getAttribute("language")).intValue();
    }

}
